import http from "@/http";

//菜单列表
export const getMenuList = (params: IMenuListParams): RES<IGetMenuList> =>
  http.get(
    `/menu/list/${params.parentId}?pageNum=${params.pageNum}&pageSize=${params.pageSize}`
  );
//编辑菜单列表
export const editMenuList = (id: number): RES<IMenuModel> =>
  http.get(`/menu/${id}`);

//添加菜单
export const createMenuAPI = (params: IMenuCreateParams): RES<number> =>
  http.post(`/menu/create`, params);

//更新菜单列表
export const menuUpdateAPI = (params: IMenuCreateParams): RES<number> =>
  http.post(`/menu/update/${params.id}`, params);


